<template>
  <div class="location">
    <ws-table :columns="tableColumns"
              :operation="operation"
              url="post|/basicParameter/location/listAll"
              zws="zws"
              @handleEdit="handleEdit"
              @handleDelete="handleDelete"
    >
      <template #unit="{row}">
        {{ row.unit.unitName }}
      </template>
      <template #content="{row}">
        {{ row.userContent.content.fastCodeName }}
      </template>
      <template #vehicleNo="{row}">
        {{ row.userContent.vehicleNo }}
      </template>
    </ws-table>
  </div>
</template>

<script setup>
defineOptions({
  name: 'basicParameter_location'
})
const state = reactive({
  tableColumns: [
    {prop: 'locationId', label: '点位编号', minWidth: 105},
    {prop: 'locationName', label: '点位名称', minWidth: 290},
    {prop: 'regionName', label: '行政区域', minWidth: 120},
    {prop: 'jurisdictionName', label: '辖区划分', minWidth: 120},
    {prop: 'areaName', label: '维护片区', minWidth: 200},
    {prop: 'locationAttrName', label: '点位属性', minWidth: 140},
    {prop: 'locationDetailAttrName', label: '点位明细', minWidth: 140},
    {prop: 'locationLevelId', type: 'slot', label: '点位等级', minWidth: 120},
    {prop: 'locationDesc', label: '点位描述', minWidth: 270}
  ],
  operation: {
    fixed: 'right',
    width: 120,
    data: [
      {label: '修改', type: 'primary', handle: 'edit'},
      {label: '删除', type: 'danger', handle: 'delete'}
    ]
  }
})
const {tableColumns, operation} = toRefs(state)
const handleEdit = (row, index) => {
  console.log(index, row)
}
const handleDelete = (row, index) => {
  console.log(index, row)
  console.log('=>(index.vue:55) ')
}
</script>

<style lang="scss" scoped>
.location {
  width: 100%;
  height: 100%;
  position: relative;
}
</style>
